home *** CD-ROM | disk | FTP | other *** search
- // -[Keep_Heading]-
-
-
- // -[Copyright_Mesg]-
- // --------------------------------------------------------------- //
- // (c) Copyright 1993-1994. Step Ahead Software Pty Limited. All rights reserved.
- // Class Source Filename: TRIANGLE.cpp
- // Description:
- // Implements triangle objects.
- // --------------------------------------------------------------- //
-
-
- #include "TRIANGLE.h"
-
-
- // -[Keep_cpp_Extras]-
-
-
- // -[Module_Function_Decs]-
-
-
- // -[Module_Data_Decs_Def]-
-
-
- // -[Global_Data_Defs]-
-
-
- // -[Static_Member_Data_Defs]-
-
-
- // -[Function_Defs]-
-
- // Returns a hash value
- hashValueType
- Triangle::hashValue() const
- {
- return 0;
- }
-
- void
- Triangle::write(Ropstream os)
- {
- // Call to base class write functions
- os << SideLength;
- }
-
- Pvoid
- Triangle::read(Ripstream is)
- {
- // Call to base class read functions
- is >> SideLength;
- return this;
- }
-
- // Constructs the object before a stream input operation
- Triangle::Triangle(StreamableInit s)
- : Shape(s)
-
- {
- }
-
- // Output Class Info
- void
- Triangle::printOn(Rostream outputStream) const
- {
- }
-
- // Class Name
- char *
- Triangle::nameOf() const
- {
- return "Triangle";
- }
-
- // Tests Equality
- int
- Triangle::isEqual(const Object& testObject) const
- {
- return FALSE;
- }
-
- // Unique class ID
- classType
- Triangle::isA() const
- {
- return TriangleClass;
- }
-
- // Constructs the triangle with given side length.
- Triangle::Triangle(int InitX, int InitY, int InitSide)
- : Shape(InitX, InitY)
- {
- }
-
- // Draws an equilateral triangle of side length stored in the SideLength data
- // member.
- void
- Triangle::Show(HDC hDC)
- {
- // Implementation left to the user as an exercise -
- // Famous quote found in just about every text book
- // I have ever read!
- }
-
-
- // -[Persistent]-
- // OWL 1.0 streamability
- PTStreamable Triangle::build()
- {
- return new Triangle(streamableInit);
- }
-
- const Pchar Triangle::streamableName() const
- {
- return "Triangle";
- }
-
- TStreamableClass RegTriangle("Triangle", Triangle::build,
- __DELTA(Triangle));